import request from '@/utils/request';

// 工时填报(新增)接口
export function apiWorkhourAdd(data) {
  return request({
    url: '/workhour/v1/add',
    method: 'post',
    data: data
  });
}

// 工时修改接口
export function apiWorkhourUpdate(data) {
  return request({
    url: '/workhour/v1/update',
    method: 'put',
    data: data
  });
}

// 工时删除接口
export function apiWorkhourDel(data) {
  return request({
    url: '/workhour/v1/'+data,
    method: 'delete'
  });
}

// 工时列表查询（分页）
export function apiGetHourList(query) {
  return request({
    url: '/workhour/v1/getHourList',
    method: 'get',
    params: query
  });
}

// 发送周报接口
export function apiWeekReportSend(data) {
  return request({
    url: '/weekReport/v1/send',
    method: 'post',
    data: data
  });
}

// 周报邮件设置
export function apiWeekEmailAdd(data) {
  return request({
    url: '/weekEmail/v1/add',
    method: 'post',
    data: data
  });
}

// 工时填写项目
export function apiListbystatusProject(data) {
  return request({
    url: '/project/manage/listbystatus',
    method: 'get',
    params: data
  });
}

// 获取项目级联数据
export function apiWorkhourTypeList() {
  return request({
    url: '/work_hour/type/list',
    method: 'get'
  });
}

// 批量工时填报
export function apiWorkhourAddbatch(data) {
  return request({
    url: '/workhour/v1/addbatch',
    method:'post',
    data: data
  });
}

// 复制上周工时
export function apiCopyLastWeekWorkHour() {
  return request({
    url: '/workhour/v1/copyLastWeekWorkHour',
    method: 'get'
  });
}
